package org.chabad.android;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.*;
import android.view.View.*;

public class WelcomeActivity extends Activity {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.welcome);
        
        OnClickListener evt = new OnClickListener() {
		    public void onClick(View v) {
		    	Intent i = new Intent();
		    	i.setClassName("org.chabad.android","org.chabad.android.Zmanim");
		    	switch(v.getId())
		    	{
		    		case R.id.cmd_home:
				    	i.putExtra("org.chabad.android.UrlId", R.string.home_url);
				    	break;
		    		case R.id.cmd_locate:
				    	i.putExtra("org.chabad.android.UrlId", R.string.locate_url);
				    	break;
		    		case R.id.cmd_times:
				    	i.putExtra("org.chabad.android.UrlId", R.string.zmanim_url);
				    	break;
		    		case R.id.cmd_candlelighting:
				    	i.putExtra("org.chabad.android.UrlId", R.string.candlelighting_url);
				    	break;
		    		case R.id.cmd_dailystudy:
				    	i.putExtra("org.chabad.android.UrlId", R.string.dailystudy_url);
				    	break;		    	
		    	}
		    	startActivity(i);
		    }
        };
        findViewById(R.id.cmd_home).setOnClickListener(evt);
        findViewById(R.id.cmd_locate).setOnClickListener(evt);
        findViewById(R.id.cmd_times).setOnClickListener(evt);
        findViewById(R.id.cmd_candlelighting).setOnClickListener(evt);
        findViewById(R.id.cmd_dailystudy).setOnClickListener(evt);
    }
}
